﻿using System.ComponentModel.Composition;
using System.Windows.Media;
using Microsoft.VisualStudio.Text.Classification;
using Microsoft.VisualStudio.Utilities;
using PSLib.CodeFormating.Lexems;

namespace LuaLanguageExtension
{
    #region Format definition

    /// <summary>
    /// Defines an editor format for the None type
    /// </summary>
    [Export(typeof(EditorFormatDefinition))]
    [ClassificationType(ClassificationTypeNames = "PSLib.None")]
    [Name("PSLib.None")]
    [UserVisible(false)] //this should be visible to the end user
    [Order(Before = Priority.Default)] //set the priority to be after the default classifiers
    internal sealed class NoneFormat : ClassificationFormatDefinition
    {
        /// <summary>
        /// Defines the visual format for the "LexemType.None" classification type
        /// </summary>
        public NoneFormat()
        {
            this.DisplayName = "None"; //human readable version of the name
        }
    }

    /// <summary>
    /// Defines an editor format for the BreakLine type
    /// </summary>
    [Export(typeof(EditorFormatDefinition))]
    [ClassificationType(ClassificationTypeNames = "PSLib.BreakLine")]
    [Name("PSLib.BreakLine")]
    [UserVisible(false)] //this should be visible to the end user
    [Order(Before = Priority.Default)] //set the priority to be after the default classifiers
    internal sealed class BreakLineFormat : ClassificationFormatDefinition
    {
        /// <summary>
        /// Defines the visual format for the "LexemType.BreakLine" classification type
        /// </summary>
        public BreakLineFormat()
        {
            this.DisplayName = "BreakLine"; //human readable version of the name
        }
    }

    /// <summary>
    /// Defines an editor format for the Space type
    /// </summary>
    [Export(typeof(EditorFormatDefinition))]
    [ClassificationType(ClassificationTypeNames = "PSLib.Space")]
    [Name("PSLib.Space")]
    [UserVisible(false)] //this should be visible to the end user
    [Order(Before = Priority.Default)] //set the priority to be after the default classifiers
    internal sealed class SpaceFormat : ClassificationFormatDefinition
    {
        /// <summary>
        /// Defines the visual format for the "LexemType.Space" classification type
        /// </summary>
        public SpaceFormat()
        {
            this.DisplayName = "Space"; //human readable version of the name
        }
    }

    /// <summary>
    /// Defines an editor format for the Operator type
    /// </summary>
    [Export(typeof(EditorFormatDefinition))]
    [ClassificationType(ClassificationTypeNames = "PSLib.Operator")]
    [Name("PSLib.Operator")]
    [UserVisible(false)] //this should be visible to the end user
    [Order(Before = Priority.Default)] //set the priority to be after the default classifiers
    internal sealed class OperatorFormat : ClassificationFormatDefinition
    {
        /// <summary>
        /// Defines the visual format for the "LexemType.Operator" classification type
        /// </summary>
        public OperatorFormat()
        {
            this.DisplayName = "Operator"; //human readable version of the name
            this.ForegroundColor = Colors.Blue;
        }
    }

    /// <summary>
    /// Defines an editor format for the Symbol type
    /// </summary>
    [Export(typeof(EditorFormatDefinition))]
    [ClassificationType(ClassificationTypeNames = "PSLib.Symbol")]
    [Name("PSLib.Symbol")]
    [UserVisible(false)] //this should be visible to the end user
    [Order(Before = Priority.Default)] //set the priority to be after the default classifiers
    internal sealed class SymbolFormat : ClassificationFormatDefinition
    {
        /// <summary>
        /// Defines the visual format for the "LexemType.Symbol" classification type
        /// </summary>
        public SymbolFormat()
        {
            this.DisplayName = "Symbol"; //human readable version of the name
            this.ForegroundColor = Colors.Blue;
        }
    }

    /// <summary>
    /// Defines an editor format for the Punctuation type
    /// </summary>
    [Export(typeof(EditorFormatDefinition))]
    [ClassificationType(ClassificationTypeNames = "PSLib.Punctuation")]
    [Name("PSLib.Punctuation")]
    [UserVisible(false)] //this should be visible to the end user
    [Order(Before = Priority.Default)] //set the priority to be after the default classifiers
    internal sealed class PunctuationFormat : ClassificationFormatDefinition
    {
        /// <summary>
        /// Defines the visual format for the "LexemType.Punctuation" classification type
        /// </summary>
        public PunctuationFormat()
        {
            this.DisplayName = "Punctuation"; //human readable version of the name
        }
    }

    /// <summary>
    /// Defines an editor format for the Word type
    /// </summary>
    [Export(typeof(EditorFormatDefinition))]
    [ClassificationType(ClassificationTypeNames = "PSLib.Word")]
    [Name("PSLib.Word")]
    [UserVisible(false)] //this should be visible to the end user
    [Order(Before = Priority.Default)] //set the priority to be after the default classifiers
    internal sealed class WordFormat : ClassificationFormatDefinition
    {
        /// <summary>
        /// Defines the visual format for the "LexemType.Word" classification type
        /// </summary>
        public WordFormat()
        {
            this.DisplayName = "Word"; //human readable version of the name
        }
    }

    /// <summary>
    /// Defines an editor format for the Constant type
    /// </summary>
    [Export(typeof(EditorFormatDefinition))]
    [ClassificationType(ClassificationTypeNames = "PSLib.Constant")]
    [Name("PSLib.Constant")]
    [UserVisible(false)] //this should be visible to the end user
    [Order(Before = Priority.Default)] //set the priority to be after the default classifiers
    internal sealed class ConstantFormat : ClassificationFormatDefinition
    {
        /// <summary>
        /// Defines the visual format for the "LexemType.Constant" classification type
        /// </summary>
        public ConstantFormat()
        {
            this.DisplayName = "Constant"; //human readable version of the name
            this.ForegroundColor = Colors.Blue;
        }
    }

     /// <summary>
     /// Defines an editor format for the Digit type
    /// </summary>
    [Export(typeof(EditorFormatDefinition))]
    [ClassificationType(ClassificationTypeNames = "PSLib.Digit")]
    [Name("PSLib.Digit")]
    [UserVisible(false)] //this should be visible to the end user
    [Order(Before = Priority.Default)] //set the priority to be after the default classifiers
    internal sealed class DigitFormat : ClassificationFormatDefinition
    {
        /// <summary>
        /// Defines the visual format for the "LexemType.Digit" classification type
        /// </summary>
        public DigitFormat()
        {
            this.DisplayName = "Digit"; //human readable version of the name
            this.ForegroundColor = Colors.DarkOrchid;
        }
    }

    /// <summary>
    /// Defines an editor format for the String type
    /// </summary>
    [Export(typeof(EditorFormatDefinition))]
    [ClassificationType(ClassificationTypeNames = "PSLib.String")]
    [Name("PSLib.String")]
    [UserVisible(false)] //this should be visible to the end user
    [Order(Before = Priority.Default)] //set the priority to be after the default classifiers
    internal sealed class StringFormat : ClassificationFormatDefinition
    {
        /// <summary>
        /// Defines the visual format for the "LexemType.String" classification type
        /// </summary>
        public StringFormat()
        {
            this.DisplayName = "String"; //human readable version of the name
            this.ForegroundColor = Colors.Maroon;
        }
    }

    /// <summary>
    /// Defines an editor format for the Comment type
    /// </summary>
    [Export(typeof(EditorFormatDefinition))]
    [ClassificationType(ClassificationTypeNames = "PSLib.Comment")]
    [Name("PSLib.Comment")]
    [UserVisible(false)] //this should be visible to the end user
    [Order(Before = Priority.Default)] //set the priority to be after the default classifiers
    internal sealed class CommentFormat : ClassificationFormatDefinition
    {
        /// <summary>
        /// Defines the visual format for the "LexemType.Comment" classification type
        /// </summary>
        public CommentFormat()
        {
            this.DisplayName = "Comment"; //human readable version of the name
            this.ForegroundColor = Colors.Green;
        }
    }

    /// <summary>
    /// Defines an editor format for the FunctionCall type
    /// </summary>
    [Export(typeof(EditorFormatDefinition))]
    [ClassificationType(ClassificationTypeNames = "PSLib.FunctionCall")]
    [Name("PSLib.FunctionCall")]
    [UserVisible(false)] //this should be visible to the end user
    [Order(Before = Priority.Default)] //set the priority to be after the default classifiers
    internal sealed class FunctionCallFormat : ClassificationFormatDefinition
    {
        /// <summary>
        /// Defines the visual format for the "LexemType.FunctionCall" classification type
        /// </summary>
        public FunctionCallFormat()
        {
            this.DisplayName = "FunctionCall"; //human readable version of the name
            this.ForegroundColor = Colors.Teal;
        }
    }

    /// <summary>
    /// Defines an editor format for the FunctionDefinition type
    /// </summary>
    [Export(typeof(EditorFormatDefinition))]
    [ClassificationType(ClassificationTypeNames = "PSLib.FunctionDefinition")]
    [Name("PSLib.FunctionDefinition")]
    [UserVisible(false)] //this should be visible to the end user
    [Order(Before = Priority.Default)] //set the priority to be after the default classifiers
    internal sealed class FunctionDefinitionFormat : ClassificationFormatDefinition
    {
        /// <summary>
        /// Defines the visual format for the "LexemType.FunctionDefinition" classification type
        /// </summary>
        public FunctionDefinitionFormat()
        {
            this.DisplayName = "FunctionDefinition"; //human readable version of the name
            this.ForegroundColor = Colors.Green;
        }
    }

    #endregion //Format definition
}
